package com.hzdl.hotel.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzdl.hotel.bean.Administer;
import com.hzdl.hotel.bean.Advice;
import com.hzdl.hotel.mapper.CommentMapper;
import com.hzdl.hotel.service.CommentService;
import com.hzdl.hotel.vo.AdviceVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {


    @Autowired
    private CommentMapper cm;
    @Override
    public PageInfo findAdviceByWhere(AdviceVo adviceVo) {
        PageHelper.startPage(adviceVo.getPage(),adviceVo.getLimit());
        List<Advice> aList = cm.findAdviceByWhere(adviceVo);
        PageInfo pageInfo = new PageInfo(aList);
        return pageInfo;
    }

    @Override
    public int deleteAdviceById(Integer adviceId) {
        return cm.deleteAdviceById(adviceId);
    }
}
